import { UPDATEPAGEWORKEXP } from '../types/pageworkexp'
import { createAction } from 'redux-actions'
import { insertWorkRequest, updateWorkRequest } from '../../../../service/user-archive-controller'

export const DOREQUESTWORKEXP = payload => {
  return new Promise(resolve => {
    insertWorkRequest({ ...payload }).then(({ data } = {}) => {
      resolve({
        status: data && data.status,
        message: data && data.message
      })
    })
  })
}

export const DOEDITWORKEXP = payload => {
  return new Promise(resolve => {
    updateWorkRequest({ ...payload }).then(({ data } = {}) => {
      resolve({
        status: data && data.status,
        message: data && data.message
      })
    })
  })
}
